const App = {
    mixins: [Query],//配置文件，路径/utils/mixins.js
    data() {
        return {
            page: {
                value1: '',
                PageNumber: 1, //页码
                RowAmount: 10,
                Condition: window.btoa(unescape(encodeURIComponent("%%,%%"))),
                ExtensionCondition: window.btoa(unescape(encodeURIComponent(" and  account_management.Village_SerialNumber in (" + getCookie('village') + ")"))),
            },
            showDialog1: false,
            Data: [],
        }
    },
    mounted() {

    },
    methods: {
        Treedata() {
            // $.ajax({
            //     headers: requestHeaders(),
            //     url: `${mh}/clientOperation/getDistrictTree`,
            //     type: "GET",
            //     data: {
            //         DistrictCode: '232723'
            //     },
            //     success: (data) => {
            //         this.treeData = data; // 直接使用 this
            //     },
            //     complete: (XMLHttpRequest) => {
            //         requestPretreatment(XMLHttpRequest);
            //     },
            //     dataType: "json",
            // });


            $.ajax({
                headers: requestHeaders(),
                url: `${mh}/permissionsTree/getDistrictTreeByPermissions`,
                type: "GET",
                data: {
                    DistrictCode: getCookie('village'),
                },
                success: (data) => {
                    this.treeData = data;
                },
                complete: (XMLHttpRequest) => {
                    requestPretreatment(XMLHttpRequest);
                },
                dataType: "json",
            });
        },
        handleShow(row) {
            // this.showDialog1 = true;
            window.location.href = './show.html?Account_SerialNumber=' + row.Account_SerialNumber
            // $.ajax({
            //     headers: {
            //         "content-type": "application/x-www-form-urlencoded",
            //     },
            //     url: `${mh}/generalBusiness/generalQueryBySQLSerialNumber`,
            //     method: "post",
            //     data: {
            //         SQLSerialNumber: "f_account_transaction_details",
            //         Condition: window.btoa(unescape(encodeURIComponent("%" + row.Account_SerialNumber + "%"))),
            //     },
            //     success: (res) => {

            //         this.Data = res;
            //     },
            // });
        },
        //树的点击筛选事件
        check() {
            this.page.Condition = window.btoa(unescape(encodeURIComponent("%" + this.page.value1 + "%,%%")));
            this.postgetList(this.page)
        },
        //树的点击筛选事件
        handleNodeClick(data, node) {
            this.page.Condition = window.btoa(unescape(encodeURIComponent("%" + this.page.value1 + "%,%" + data.ProvinceNumber + "%")));
            this.postgetList(this.page)
        },
        handleEdit1(row) {
            window.location.href = './add1.html?action=Add&Account_SerialNumber=' + row.Account_SerialNumber
        },
        xinwen() {
            window.location.href = '../../news_videos_files/news/add.html?action=Add'
        }
    },
};

const { createApp } = Vue;
const app = createApp(App);
//这种方式是引入全部图标，无需单个引入
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
    app.component(key, component);
}
const ElMessage = ElementPlus.ElMessage;
app.use(ElementPlus, { locale: zhCn });
app.mount("#app");
